package com.hycc.base;

public class Lamda2 {

    public static void main(String[] args) {
        Run car = null;

        class Car implements Run{
            @Override
            public void running(int speed,int level) {
                System.out.println("汽车行驶中，速度为"+speed+"level"+level);
            }


        }

        car = new Car();
        car.running(30,1);

        car = new Run() {
            @Override
            public void running(int speed,int level) {
                System.out.println("什么东西正在跑，速度为"+speed+"level"+level);
            }


        };
        car.running(40,2);

        car = (speed,level) -> {System.out.println("xx正在跑，速度为"+speed+"level"+level);};
        car.running(50,3);

        car = (speed,level) -> System.out.println("跑的速度为"+speed+"level"+level);
        car.running(60,4);
    }
}

interface Run{
    void running(int speed,int level);

}